package edu.gatech.ealf.magiclenseplaf;

import javax.swing.UIDefaults;

import edu.gatech.ealf.AuxiliaryLookAndFeel;
import edu.gatech.ealf.AuxiliaryUIDefaults;

public class MagicLenseLookAndFeel extends AuxiliaryLookAndFeel {

	
    /**
     * The multiplicative factor that components size will be multiplied by.
     */
    private double zoomFactor = 1.5;
    
    private static MagicLenseLookAndFeel instance = null;
    
    public static MagicLenseLookAndFeel getInstance(){
    	if(instance == null){
    		instance = new MagicLenseLookAndFeel();
    	}
    	return instance;
    }
    
	private MagicLenseLookAndFeel(){

		uidefaults = new AuxiliaryUIDefaults();
        Object[] uiDefaults = {
         "ButtonUI" , "edu.gatech.ealf.magiclenseplaf.MLButtonUI",
         "ToggleButtonUI" , "edu.gatech.ealf.magiclenseplaf.MLGenericUI",
         "SliderUI" , "edu.gatech.ealf.magiclenseplaf.MLGenericUI",
         "RadioButtonUI", "edu.gatech.ealf.magiclenseplaf.MLGenericUI",
         "RadioButtonMenuItemUI", "edu.gatech.ealf.magiclenseplaf.MLGenericUI",
         "CheckBoxUI", "edu.gatech.ealf.magiclenseplaf.MLGenericUI",
         "CheckBoxMenuItemUI", "edu.gatech.ealf.magiclenseplaf.MLGenericUI",
         "ComboBoxUI", "edu.gatech.ealf.magiclenseplaf.MLComboBoxUI",
         "LabelUI", "edu.gatech.ealf.magiclenseplaf.MLGenericUI",
         "TreeUI", "edu.gatech.ealf.magiclenseplaf.MLTreeUI",
         "ScrollBarUI", "edu.gatech.ealf.magiclenseplaf.MLScrollBarUI",
         "TextFieldUI", "edu.gatech.ealf.magiclenseplaf.MLTextUI",
         "PasswordFieldUI", "edu.gatech.ealf.magiclenseplaf.MLTextUI",
         "ListUI", "edu.gatech.ealf.magiclenseplaf.MLListUI",
         "ProgressBarUI", "edu.gatech.ealf.magiclenseplaf.MLGenericUI",
         "TextAreaUI", "edu.gatech.ealf.magiclenseplaf.MLTextUI",
         "MenuItemUI", "edu.gatech.ealf.magiclenseplaf.MLGenericUI",
         "EditorPaneUI", "edu.gatech.ealf.magiclenseplaf.MLTextUI",
         "FormattedTextFieldUI", "edu.gatech.ealf.magiclenseplaf.MLTextUI",
         "TextPaneUI", "edu.gatech.ealf.magiclenseplaf.MLTextUI",
         "ScrollPaneUI", "edu.gatech.ealf.magiclenseplaf.MLScrollPaneUI",
         "SpinnerUI" , "edu.gatech.ealf.magiclenseplaf.MLSpinnerUI",
         "FilePaneUI" , "edu.gatech.ealf.magiclenseplaf.MLGenericUI",
         
         "FileChooserUI", "edu.gatech.ealf.magiclenseplaf.MLFileChooserUI",
         //"SplitPaneUI", "edu.gatech.ealf.magiclenseplaf.MLGenericUI",
         "ViewportUI", "edu.gatech.ealf.magiclenseplaf.MLViewportUI",
         //"MenuUI", "edu.gatech.ealf.magiclenseplaf.MLGenericUI",
         //"TableHeaderUI", "edu.gatech.ealf.magiclenseplaf.MLGenericUI",
         //"TableUI", "edu.gatech.ealf.magiclenseplaf.MLGenericUI",
         //"TabbedPaneUI", "edu.gatech.ealf.magiclenseplaf.MLGenericUI",
         //"ToolTipUI", "edu.gatech.ealf.magiclenseplaf.MLGenericUI",
         //"MenuBarUI", "edu.gatech.ealf.magiclenseplaf.MLGenericUI",
         //"ColorChooserUI", "edu.gatech.ealf.magiclenseplaf.MLGenericUI",
         //"ToolBarUI", "edu.gatech.ealf.magiclenseplaf.MLGenericUI",
         //"PopupMenuUI", "edu.gatech.ealf.magiclenseplaf.MLGenericUI",
        };
        uidefaults.putDefaults(uiDefaults);
        

	}
	
	@Override
	public String getDescription() {
		return "A Look and Feel that adds some magic lenses to the components";
	}

	@Override
	public String getID() {
		return "MagicLenseLookAndFeel";
	}

	@Override
	public String getName() {
		return "MagicLenseLookAndFeel";
	}

	@Override
	public boolean isNativeLookAndFeel() {
		return false;
	}

	@Override
	public boolean isSupportedLookAndFeel() {
		return true;
	}
	
	@Override
	public UIDefaults getDefaults() {
        return uidefaults;
    }

    public double getZoomFactor() {
        return zoomFactor;
    }

    public void setZoomFactor(double zoomFactor) {
        this.zoomFactor = zoomFactor;
    }
    
    
    

    
}
